package jed.DistributedEventingTests;

import javaEventing.EventManager;
import jed.DistributedEvent;


import jed.DistributedEventManagerExtension;
import junit.framework.TestCase;

/**
 * Created by Espen Skjervold, FFI, 01.feb.2011
 */
public class DistributedTests extends TestCase {


    public void testDistributedEvents() {

        class MyDistributedEvent implements DistributedEvent {
            public Object getPayload() {
                return null;  //To change body of implemented methods use File | Settings | File Templates.
            }
        }


        EventManager.setEventManagerExtension(new DistributedEventManagerExtension());

        EventManager.registerEventListener(new javaEventing.EventManager.GenericEventListener() {
            public void eventTriggered(Object sender, EventManager.Event event) {
                System.out.println("event received");
            }
        }, new MyDistributedEvent());
        

        EventManager.triggerEvent(this, new MyDistributedEvent());

    }


}
